package com.itheima.mycollection;

import java.util.ArrayList;
import java.util.Iterator;

public class Demo {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();

        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("ddd");
        list.add("eee");
        list.add("eee");
        Iterator<String> it = list.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
            System.out.println(it.next().length());
        }
    }
}
